const getMenuTree = [
  {
    id: '1',
    name: '权限管理',
    route: '/test1',
    icon: 'MailOutlined',
    isShow: true,
    children: [
      {
        id: '2',
        name: '用户管理',
        route: '/sub-app1/user',
        icon: '',
        isShow: true,
      },
      {
        id: '3',
        name: '角色管理',
        route: '/sub-app1/role',
        icon: 'MailOutlined',
        isShow: true,
      },
    ],
  },
  {
    id: '4',
    name: '业务菜单',
    route: '/test2',
    icon: 'MailOutlined',
    isShow: true,
    children: [
      {
        id: '10',
        name: '应用首页',
        route: '/sub-app1',
        icon: 'MailOutlined',
        isShow: true,
      },
      {
        id: '5',
        name: '工作台',
        route: '/sub-app1/workplace',
        icon: 'MailOutlined',
        isShow: true,
      },
      {
        id: '6',
        name: '外链',
        route: '/sub-app1/externalLinks',
        icon: 'MailOutlined',
        isShow: true,
      },
      {
        id: '11',
        name: '404',
        route: '/sub-app1/home',
        icon: 'MailOutlined',
        isShow: true,
      },
    ],
  },
];

const getMenuTree1 = [
  {
    id: '4',
    name: '业务菜单',
    route: '/test2',
    icon: 'MailOutlined',
    isShow: true,
    children: [
      {
        id: '10',
        name: '应用首页',
        route: '/sub-app1',
        icon: 'MailOutlined',
        isShow: true,
      },
      {
        id: '5',
        name: '工作台',
        route: '/sub-app1/workplace',
        icon: 'MailOutlined',
        isShow: true,
      },
      {
        id: '6',
        name: '外链',
        route: '/sub-app1/externalLinks',
        icon: 'MailOutlined',
        isShow: true,
      },
      {
        id: '11',
        name: '404',
        route: '/sub-app1/home',
        icon: 'MailOutlined',
        isShow: true,
      },
    ],
  },
];

export default {
  'POST  /api/menu/menuTree': (req, res) => {
    const { menuTreeNo } = req.body;
    // 在启动控制台查看日志
    console.log(req.body);
    var menuTree = getMenuTree;
    console.log(menuTreeNo == '1');
    if (menuTreeNo == '1') {
      menuTree = getMenuTree1;
    }
    res.send(menuTree);
  },
};
